#!/usr/bin/env bash
# Copyright (c) 2020 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(rmfm)
pkgdesc="Bare-bones file manager using Node.js and sas"
url="https://forgejo.sny.sh/sun/rmFM"
pkgver=1.5.1-1
timestamp=2023-12-06T08:51:41+01:00
section=utils
maintainer="Sunny <sunny@sny.sh>"
license=Unlicense
installdepends=(node simple)

source=(
    https://forgejo.sny.sh/sun/rmFM/archive/1.5.1.zip
    path_fix.patch
)
sha256sums=(
    054569a5e1f420b9046ee2c4067749a1e0bccd88acc216e485b9665a42f4dd60
    SKIP
)

prepare() {
    # Assume node to be in /opt/bin
    # This is a temporary fix for not working in remux
    patch -d "$srcdir" < "$srcdir"/path_fix.patch
}

package() {
    install -D -m 755 "$srcdir"/rmfm "$pkgdir"/opt/bin/rmfm
    install -D -m 644 "$srcdir"/rmfm.draft "$pkgdir"/opt/etc/draft/rmfm.draft
    install -D -m 644 "$srcdir"/rmfm.png "$pkgdir"/opt/etc/draft/icons/rmfm.png
}
